package com.dou.you.che.web.comm.http.response.base;

import com.dou.you.che.web.comm.http.response.code.RESTApiCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * API接口返回结果的父类
 * @Author 黄国刚【1058118328@qq.com】
 */
@Api(value = "Controller层返回的结果信息")
public class BaseResponse implements Serializable {

    @ApiModelProperty(value = "返回结果的代码,<0表示错误,=0表示成功")
    protected int retCode;

    @ApiModelProperty(value = "返回码的具体信息")
    protected String retMsg;

    @ApiModelProperty(value = "返回码的英文表示")
    protected String retInfo;

    public BaseResponse(RESTApiCode apiCode) {
        this.retCode = apiCode.getValue();
        this.retMsg = apiCode.getMessage();
        this.retInfo = apiCode.getInfo();
    }

    public BaseResponse(int retCode, String retMsg) {
        this.retCode = retCode;
        this.retMsg = retMsg;
    }

    public BaseResponse() {

    }

    public int getRetCode() {
        return retCode;
    }

    public void setRetCode(int retCode) {
        this.retCode = retCode;
    }

    public String getRetMsg() {
        return retMsg;
    }

    public void setRetMsg(String retMsg) {
        this.retMsg = retMsg;
    }

    public String getRetInfo() {
        return retInfo;
    }

    public void setRetInfo(String retInfo) {
        this.retInfo = retInfo;
    }
}
